<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('入库作业详情')"/>
    <style>
        [v-cloak] {
            display: none;
        }
        .el-table th.gutter{
            display: table-cell!important;
        }
    </style>
</head>
<body>
<div class="container-div">
    <div style="width: 100%;height: 50px">
        <el-button style="float: right" type="info" @click="closeModal()">返回</el-button>
    </div>
    <el-row class="deer-panel">
        <span style="color: #409EFF">入库单信息</span>
        <el-divider style="margin-top: 10px"></el-divider>
        <el-col :span="6">
            <div class="deer-ky">
                <div class="deer-key">单据号：</div>
                <div class="deer-value" v-cloak>{{billInMaster.billNo}}</div>
            </div>
        </el-col>
        <el-col :span="6">
            <div class="deer-ky">
                <div class="deer-key">创建人：</div>
                <div class="deer-value" v-cloak>{{billInMaster.createUserName}}</div>
            </div>
        </el-col>
        <el-col :span="6">
            <div class="deer-ky">
                <div class="deer-key">创建时间：</div>
                <div class="deer-value" v-cloak>{{billInMaster.createTime}}</div>
            </div>
        </el-col>
        <el-col :span="6">
            <div class="deer-ky">
                <div class="deer-key">入库类型：</div>
                <div class="deer-value" v-for="(item, index) in inTypes" :key="index" v-if="billInMaster.type == item.dictValue" v-cloak>{{item.dictLabel}}</div>
            </div>
        </el-col>
        <el-col :span="6">
            <div class="deer-ky">
                <div class="deer-key">仓库：</div>
                <div class="deer-value" v-cloak>{{billInMaster.wareName}}</div>
            </div>
        </el-col>
        <el-col :span="6">
            <div class="deer-ky">
                <div class="deer-key">状态：</div>
                <div class="deer-value" v-if="billInMaster.state == 1">未审核</div>
                <div class="deer-value" v-if="billInMaster.state == 2">审核通过</div>
                <div class="deer-value" v-if="billInMaster.state == 3">正在入库</div>
                <div class="deer-value" v-if="billInMaster.state == 4">入库完成</div>
            </div>
        </el-col>
        <el-col :span="6">
            <div class="deer-ky">
                <div class="deer-key">备注：</div>
                <div class="deer-value" v-cloak>{{billInMaster.memo}}</div>
            </div>
        </el-col>
    </el-row>
    <div style="width: 100%;margin: 20px 0;height: 40px">
        <el-button type="primary" style="float: left" @click="startOperation()" :disabled="startDisabled">开始作业</el-button>
        <el-button type="primary" style="float: left; margin-left: 10px" @click="endOperation()" :disabled="!startDisabled || billInMaster.state == 4">结束作业</el-button>
        <el-button type="success" style="float: right" @click="inWare(multipleSelection)" :disabled="showAll">确认入库</el-button>
    </div>
    <el-row :gutter="20">
        <el-col :span="24">
            <el-tabs type="border-card" class="deer-panel" style="margin-top: 15px;padding-top: 0px">
                <el-tab-pane>
                    <span slot="label"><i class="el-icon-date"></i> 组盘信息</span>
                    <el-table :data="boxItems.list" border @selection-change="handleSelectionChange">
                        <el-table-column type="selection" align="center" width="55" @selection-change="handleSelectionChange" :selectable="selectable"></el-table-column>
                        <el-table-column prop="boxCode" align="center" label="托盘">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.boxCode" style="width: 100%;hight: 100%" :disabled="scope.row.finish"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="distributionNum" align="center" label="行号" width="70"></el-table-column>
                        <el-table-column prop="itemName" align="center" label="物料名称"></el-table-column>
                        <el-table-column prop="quantity" align="center" label="计划总数" width="100"></el-table-column>
                        <el-table-column prop="benCiRuKu" align="center" label="该行号入库量" width="125"></el-table-column>
                        <el-table-column prop="taskSumQuantity" align="center" label="已下发任务总数" width="135"></el-table-column>
                        <el-table-column prop="quantityReceived" align="center" label="已入库数量" width="115"></el-table-column>
                        <el-table-column prop="surplusReceivedQuantity" align="center" label="入库数量">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.surplusReceivedQuantity" :disabled="scope.row.finish" style="width: 100%;hight: 100%"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="stowCreateTime" align="center" label="码垛时间" width="245">
                            <template slot-scope="scope">
                                <el-date-picker
                                    :disabled="scope.row.finish"
                                    :clearable="false"
                                    value-format="yyyy-MM-dd HH:mm:ss"
                                    v-model="scope.row.stowCreateTime"
                                    type="datetime"
                                    placeholder="选择日期时间">
                                </el-date-picker>
                            </template>
                        </el-table-column>
                        <el-table-column prop="roadWay" align="center" label="巷道" width="160" v-if="false">
                            <template slot-scope="scope">
                                <el-select v-model="scope.row.roadWay" placeholder="请选择巷道" :disabled="scope.row.finish" @change="getCellByShelf(scope.row.roadWay, scope.$index)">
                                    <el-option v-for="(item, index) in shelfList" :key="index" :label="item.shelfName" :value="item.shelfId"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="cellNum" align="center" label="可用货位" v-if="showCellNum" width="85"></el-table-column>
                        <el-table-column align="center" label="操作" v-if="showOperation">
                            <template slot-scope="scope">
                                <el-button v-if="!scope.row.finish" size="mini" type="primary" @click="inWare(scope.row)" plain>确认入库</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                    <el-pagination
                        @current-change="chengCurrentPage"
                        :current-page="boxItems.currentPage"
                        :page-size="boxItems.pageSize"
                        layout="prev, pager, next"
                        :total="boxItems.total">
                    </el-pagination>
                </el-tab-pane>
                <el-tab-pane>
                    <span slot="label"><i class="el-icon-date"></i> 物料详情</span>
                    <el-table :data="boxItems.list" border>
                        <el-table-column prop="itemId" align="center" label="ID" v-if="false"></el-table-column>
                        <el-table-column prop="itemCode" align="center" label="物料编码" v-if="false"></el-table-column>
                        <el-table-column prop="distributionNum" align="center" label="行号"></el-table-column>
                        <el-table-column prop="itemName" align="center" label="物料名称"></el-table-column>
                        <el-table-column prop="model" align="center" label="型号" v-if="false"></el-table-column>
                        <el-table-column prop="pdTime" align="center" label="生产日期"></el-table-column>
                        <el-table-column prop="batch" align="center" label="批次"></el-table-column>
                        <el-table-column prop="quantity" align="center" label="计划总数"></el-table-column>
                        <el-table-column prop="benCiRuKu" align="center" label="该行号入库量"></el-table-column>
                        <el-table-column prop="quantityReceived" align="center" label="已入库数量"></el-table-column>
                    </el-table>
                    <el-pagination
                        @current-change="chengCurrentPage"
                        :current-page="boxItems.currentPage"
                        :page-size="boxItems.pageSize"
                        layout="prev, pager, next"
                        :total="boxItems.total">
                    </el-pagination>
                </el-tab-pane>
                <el-tab-pane>
                    <span slot="label"><i class="el-icon-date"></i> 任务列表</span>
                    <el-table :data="taskInfos.list" border>
                        <el-table-column prop="id" align="center" label="ID" v-if="false"></el-table-column>
                        <el-table-column prop="taskNumber" align="center" label="任务编号"></el-table-column>
                        <el-table-column prop="boxCode" align="center" label="托盘号"></el-table-column>
                        <el-table-column prop="quantity" align="center" label="入库数量" width="85"></el-table-column>
                        <el-table-column prop="currentDevice" align="center" label="设备信息"></el-table-column>
                        <el-table-column prop="memo" align="center" label="货位描述"></el-table-column>
                        <el-table-column prop="itemName" align="center" label="物料名称"></el-table-column>
                        <el-table-column align="center" label="任务类型" width="100">
                            <template slot-scope="scope">
                                <el-tag>入库任务</el-tag>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="任务状态">
                            <template slot-scope="scope">
                                <el-tag v-if="scope.row.state==0">已下发</el-tag>
                                <el-tag v-if="scope.row.state==1">执行中</el-tag>
                                <el-tag v-if="scope.row.state==2">报错</el-tag>
                                <el-tag v-if="scope.row.state==3">已完成</el-tag>
                                <el-tag v-if="scope.row.state==4">取货货物不存在</el-tag>
                                <el-tag v-if="scope.row.state==5">作废</el-tag>
                                <el-tag v-if="scope.row.state==6">强制完成</el-tag>
                                <el-tag v-if="scope.row.state==7">需盘点</el-tag>
                                <el-tag v-if="scope.row.state==8">在途</el-tag>
                            </template>
                        </el-table-column>
                        <el-table-column prop="createUserName" align="center" label="操作人员" width="100"></el-table-column>
                        <el-table-column align="center" label="操作" width="250">
                            <template slot-scope="scope">
                                <el-button v-if="scope.row.state == 0" size="mini" type="success" @click="changeMsg(scope.row.id, scope.row.boxCode, scope.row.quantity)" plain>修改</el-button>
                                <el-button v-if="scope.row.state == 1 || scope.row.state == 2" size="mini" type="primary" @click="forceComplete(scope.row.id)" plain>强制完成</el-button>
                                <el-button v-if="scope.row.state == 0" size="mini" type="danger" @click="forceAbolish(scope.row.id)" plain>作废</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                    <el-pagination
                        @current-change="taskInfosChengCurrentPage"
                        :current-page="taskInfos.currentPage"
                        :page-size="taskInfos.pageSize"
                        layout="prev, pager, next"
                        :total="taskInfos.total">
                    </el-pagination>
                </el-tab-pane>
            </el-tabs>
        </el-col>
    </el-row>
    <el-dialog title="修改信息" width="320px" :visible.sync="showMsg" :close-on-click-modal="false">
        <el-row>
            <el-form label-width="100px" class="demo-ruleForm">
                <el-form-item size="small" label="托盘号:">
                    <el-input v-model="changeBoxCode"></el-input>
                </el-form-item>
                <el-form-item size="small" label="入库数量:">
                    <el-input v-model="changeNum"></el-input>
                </el-form-item>
            </el-form>
        </el-row>
        <el-row style="margin-top: 10px;text-align: center">
            <el-button size="mini" type="primary" @click="yesMsg">确定</el-button>
            <el-button size="mini" type="info" @click="noMsg">取消</el-button>
        </el-row>
    </el-dialog>
</div>

<div th:include="include::footer"></div>
<script th:inline="javascript">
    var billId = parseInt(localStorage.getItem('/in/workMaster/detail'));

    var vue = new Vue({
        el: '.container-div',
        data: {
            billInMaster: [],
            boxItems: {
                currentPage: 1,
                pageSize: 8,
                total: '',
                list: []
            },
            startDisabled: false,
            showOperation: false,
            showAll: true,
            multipleSelection: [],
            taskInfos: {
                currentPage: 1,
                pageSize: 8,
                total: '',
                list: []
            },
            shelfList: [],
            inTypes: [],
            showCellNum: false,
            showMsg: false,
            changeBoxCode: '',
            changeNum: '',
            changeId: ''
        },
        methods:{
            //返回按钮
            closeModal: function(){
                if(this.billInMaster.state == 3 && this.taskInfos.list.length == 0){
                    layer.alert("已开始作业但未下发任务，确定要返回吗？", {
                        title: "系统提示",
                        btn: ['确定','取消'],
                        yes: function(index, layero){
                            $.ajax({
                                cache: true,
                                type: "POST",
                                url: '/in/workMaster/endAssignment',
                                data: {
                                    billId: billId
                                },
                                async: false,
                                error: function(request){
                                    $.modal.alertError("系统错误");
                                },
                                success: function(data){
                                    layer.close(index);
                                    var index = parent.layer.getFrameIndex(window.name);
                                    parent.layer.close(index);
                                    $.modal.reload();
                                }
                            })
                        }
                    });
                }else{
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                    $.modal.reload();
                }
            },
            //获取入库单信息
            getBillMaster: function(){
                var that = this;
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: '/in/workMaster/findBillInMasterById',
                    data: {
                        billId: billId
                    },
                    async: false,
                    error: function(request){
                        $.modal.alertError("系统错误");
                    },
                    success: function(data){
                        data.createTime = data.createTime.slice(0, 19);
                        that.billInMaster = data;
                    }
                });
            },
            //物料详情分页
            chengCurrentPage: function(currentPage){
                this.boxItems.currentPage = currentPage;
                this.getBillDetails(null);
            },
            //获取物料详情
            getBillDetails: function(){
                var that = this;
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: '/in/workMaster/findBillInDetailListsByBillId',
                    data: {
                        billId: billId,
                        pageSize: that.boxItems.pageSize,
                        pageNum: that.boxItems.currentPage
                    },
                    async: false,
                    error: function(request){
                        $.modal.alertError("系统错误");
                    },
                    success: function(data){
                        var msg = data.rows;
                        for(var i = 0; i < msg.length; i++){
                            if(msg[i].quantityReceived == null){
                                msg[i].quantityReceived = 0;
                            }
                            if(msg[i].taskSumQuantity == null){
                                msg[i].taskSumQuantity = 0;
                            }
                            msg[i].surplusReceivedQuantity = '';
                            msg[i].stowCreateTime = '';
                            if(msg[i].benCiRuKu == null){
                                if(msg[i].quantity == msg[i].taskSumQuantity){
                                    msg[i].finish = true;
                                }else{
                                    msg[i].finish = false;
                                }
                            }else{
                                if(msg[i].benCiRuKu == msg[i].taskSumQuantity){
                                    msg[i].finish = true;
                                }else{
                                    msg[i].finish = false;
                                }
                            }
                            if(msg[i].pdTime != null){
                                msg[i].pdTime = msg[i].pdTime.slice(0, 10);
                            }
                        }
                        that.boxItems.list = msg;
                        that.boxItems.total = data.total;
                    }
                });
            },
            //任务列表分页
            taskInfosChengCurrentPage: function(currentPage){
                this.taskInfos.currentPage = currentPage;
                this.getTaskInfos(null);
            },
            //获取任务列表
            getTaskInfos: function(){
                var that = this;
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: ctx + "in/workMaster/getTaskinfoByBillId",
                    data: {
                        billId: billId,
                        pageSize: that.taskInfos.pageSize,
                        pageNum: that.taskInfos.currentPage
                    },
                    async: false,
                    error: function(request){
                        $.modal.alertError("系统错误");
                    },
                    success: function(data){
                        that.taskInfos.list = data.rows;
                        that.taskInfos.total = data.total;
                    }
                });
            },
            //确认入库按钮
            inWare: function(event){
                var that = this;
                var arr = [];
                if(event.length == undefined){
                    arr.push(event);
                }else{
                    arr = event;
                }
                var checkLength = 0;
                if(arr.length == 0){
                    $.modal.alertWarning("请至少选择一条记录");
                }else{
                    for(var i = 0; i < arr.length; i++){
                        if(typeof(arr[i].boxCode) == 'object'){
                            $.modal.alertError("托盘不能为空！！");
                            return;
                        }else{
                            arr[i].boxCode = arr[i].boxCode.replace(/\s+/g,'');
                            if(arr[i].boxCode == ''){
                                $.modal.alertError("托盘不能为空！！");
                                return;
                            }else{
                                if(typeof(arr[i].surplusReceivedQuantity) == 'object'){
                                    $.modal.alertError("入库数量不能为空！！");
                                    return;
                                }else{
                                    arr[i].surplusReceivedQuantity = arr[i].surplusReceivedQuantity.replace(/\s+/g,'');
                                    if(arr[i].surplusReceivedQuantity == ''){
                                        $.modal.alertError("入库数量不能为空！！");
                                        return;
                                    }else{
                                        var reg = /^[1-9]\d*$/;
                                        var res = reg.test(arr[i].surplusReceivedQuantity);
                                        if(!res){
                                            $.modal.alertError("请输入非零开头的正整数！！");
                                            return;
                                        }else{
                                            var difference = 0;
                                            if(arr[i].benCiRuKu == null){
                                                difference = arr[i].quantity - arr[i].taskSumQuantity;
                                            }else{
                                                difference = arr[i].benCiRuKu - arr[i].taskSumQuantity;
                                            }
                                            if(arr[i].surplusReceivedQuantity > difference){
                                                if(arr[i].benCiRuKu == null){
                                                    $.modal.alertError("入库数量超过计划总数, 请重新输入！！");
                                                    return;
                                                }else{
                                                    $.modal.alertError("入库数量超过该行号入库量, 请重新输入！！");
                                                    return;
                                                }
                                            }else{
                                                if(arr[i].stowCreateTime == ''){
                                                    $.modal.alertError("请选择码垛时间！！");
                                                    return;
                                                }else{
                                                    checkLength += 1;
                                                }
                                                // if(typeof(arr[i].roadWay) == 'object'){
                                                //     $.modal.alertError("请选择巷道！！");
                                                //     return;
                                                // }else{
                                                //     checkLength += 1;
                                                // }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if(checkLength == arr.length){
                        $.ajax({
                            cache: true,
                            type: "POST",
                            url: "/rocketmq/push",
                            data: JSON.stringify({
                                billInMaster: that.billInMaster,
                                billInDetailList: arr
                            }),
                            dataType: "json",
                            contentType: "application/json;charset-UTF-8",
                            async: false,
                            error: function(request){
                                $.modal.alertError("系统错误");
                            },
                            success: function(data){
                                if(data.code == web_status.SUCCESS){
                                    layer.alert(data.msg, {
                                        title: "系统提示",
                                        icon: 6,
                                        end: function(){
                                            that.getBillMaster();
                                            that.getBillDetails();
                                            that.getTaskInfos();
                                            that.showCellNum = false;
                                        }
                                    });
                                }else if(data.code == web_status.WARNING){
                                    $.modal.alertWarning(data.msg)
                                }else{
                                    $.modal.alertError(data.msg);
                                }
                            }
                        })
                    }
                }
            },
            //开始作业按钮
            startOperation: function(){
                var that = this;
                if(this.showOperation == false){
                    layer.alert("确定要开始作业吗？", {
                        title: "系统提示",
                        btn: ['确定','取消'],
                        yes: function(index, layero){
                            $.ajax({
                                cache: true,
                                type: "POST",
                                url: '/in/workMaster/startAssignment',
                                data: {
                                    billId: billId
                                },
                                async: false,
                                error: function(request){
                                    $.modal.alertError("系统错误");
                                },
                                success: function(data){
                                    that.getBillMaster();
                                    that.showOperation = true;
                                    that.showAll = false;
                                    that.startDisabled = true;
                                    layer.close(index);
                                }
                            })
                        }
                    });
                }
            },
            //结束作业按钮
            endOperation: function(){
                var that = this;
                if(this.billInMaster.state == 3 && this.taskInfos.list.length == 0){
                    layer.alert("确定要结束作业吗？", {
                        title: "系统提示",
                        btn: ['确定','取消'],
                        yes: function(index, layero){
                            $.ajax({
                                cache: true,
                                type: "POST",
                                url: '/in/workMaster/endAssignment',
                                data: {
                                    billId: billId
                                },
                                async: false,
                                error: function(request){
                                    $.modal.alertError("系统错误");
                                },
                                success: function(data){
                                    layer.close(index);
                                    var index = parent.layer.getFrameIndex(window.name);
                                    parent.layer.close(index);
                                    $.modal.reload();
                                }
                            })
                        }
                    });
                }else if(this.billInMaster.state == 3 && this.taskInfos.list.length != 0){
                    $.modal.alertError('任务已生成，不能结束作业！')
                }
            },
            //复选框选择
            handleSelectionChange(val){
                this.multipleSelection = val;
            },
            //复选框是否禁用
            selectable: function(row, index){
                if(row.finish == true){
                    return false;
                }else{
                    return true;
                }
            },
            //根据入库单状态判断按钮操作
            being: function(){
                if(this.billInMaster.state == 3){
                    this.showOperation = true;
                    this.showAll = false;
                    this.startDisabled = true;
                }else if(this.billInMaster.state == 4){
                    this.showOperation = false;
                    this.showAll = true;
                    this.startDisabled = true;
                }
            },
            //获取入库类型列表
            getInTypes: function(){
                var that = this;
                $.ajax({
                    cache: true,
                    url: '/system/dict/data/list',
                    type: 'POST',
                    data: {
                        dictType: 'put_goods_type'
                    },
                    async: false,
                    error: function(request){
                        $.modal.alertError("系统错误");
                    },
                    success: function(data){
                        that.inTypes = data.rows;
                    }
                })
            },
            //获取可用货位
            getCellByShelf(id, rowIndex){
                var that = this;
                $.ajax({
                    cache: true,
                    url: '/system/cellInfo/selectNullCellInfo',
                    type: 'POST',
                    data: {
                        shelfId: id
                    },
                    async: false,
                    error: function(request){
                        $.modal.alertError("系统错误");
                    },
                    success: function(data){
                        that.showCellNum = true;
                        that.boxItems.list[rowIndex].cellNum = data.total - 6;
                    }
                })
            },
            //获取巷道列表
            getShelfList: function(){
                var that = this;
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: "/system/shelfInfo/list",
                    data: {},
                    async: false,
                    error: function(request){
                        $.modal.alertError("系统错误");
                    },
                    success: function(data){
                        that.shelfList = data.rows;
                    }
                });
            },
            //强制完成按钮
            forceComplete(id){
                var that = this;
                layer.alert("确定进行此操作吗？", {
                    title: "系统提示",
                    btn: ['确定','取消'],
                    yes: function(index, layero){
                        $.ajax({
                            cache: true,
                            type: "POST",
                            url: '/in/billlIntaskInfo/billInForceComplete',
                            data: {
                                id: id
                            },
                            async: false,
                            error: function(request){
                                $.modal.alertError("系统错误");
                            },
                            success: function(data){
                                layer.close(index);
                                if(data.code == web_status.SUCCESS){
                                    layer.alert(data.msg, {
                                        title: "系统提示",
                                        icon: 6,
                                        end: function(){
                                            that.getBillMaster();
                                            that.getBillDetails();
                                            that.getTaskInfos();
                                            that.showCellNum = false;
                                        }
                                    });
                                }else if(data.code == web_status.WARNING){
                                    $.modal.alertWarning(data.msg)
                                }else{
                                    $.modal.alertError(data.msg);
                                }
                            }
                        })
                    }
                });
            },
            //作废按钮
            forceAbolish(id){
                var that = this;
                layer.alert("确定进行此操作吗？", {
                    title: "系统提示",
                    btn: ['确定','取消'],
                    yes: function(index, layero){
                        $.ajax({
                            cache: true,
                            type: "POST",
                            url: '/in/billlIntaskInfo/billInTaskInvalid',
                            data: {
                                id: id
                            },
                            async: false,
                            error: function(request){
                                $.modal.alertError("系统错误");
                            },
                            success: function(data){
                                layer.close(index);
                                if(data.code == web_status.SUCCESS){
                                    layer.alert(data.msg, {
                                        title: "系统提示",
                                        icon: 6,
                                        end: function(){
                                            that.getBillMaster();
                                            that.getBillDetails();
                                            that.getTaskInfos();
                                            that.showCellNum = false;
                                        }
                                    });
                                }else if(data.code == web_status.WARNING){
                                    $.modal.alertWarning(data.msg)
                                }else{
                                    $.modal.alertError(data.msg);
                                }
                            }
                        })
                    }
                });
            },
            //修改按钮
            changeMsg(id, boxCode, quantity){
                this.showMsg = true;
                this.changeId = id;
                this.changeBoxCode = boxCode;
                this.changeNum = quantity;
            },
            //确定修改
            yesMsg(){
                var that = this;
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: '/in/workMaster/updateZuPan',
                    data: {
                        id: that.changeId,
                        boxCode: that.changeBoxCode,
                        quantity: that.changeNum
                    },
                    async: false,
                    error: function(request){
                        $.modal.alertError("系统错误");
                    },
                    success: function(data){
                        that.showMsg = false;
                        that.getTaskInfos();
                        that.getBillDetails();
                        that.changeId = '';
                        that.changeBoxCode = '';
                        that.changeNum = '';
                    }
                })
            },
            //取消修改
            noMsg(){
                this.showMsg = false;
                this.changeId = '';
                this.changeBoxCode = '';
                this.changeNum = '';
            }
        },
        created(){
            this.getBillMaster();
            this.getBillDetails();
            this.getTaskInfos();
            this.getInTypes();
            this.getShelfList();
        },
        mounted(){
            this.being();
        }
    })
</script>
</body>
</html>
